package net.xdclass.mapper;

import io.swagger.annotations.ApiParam;
import net.xdclass.model.CouponRecordDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author wly
 * @since 2021-09-16
 */
@Mapper
public interface CouponRecordMapper extends BaseMapper<CouponRecordDO> {


    /**
     * 批量更新优惠券使用记录
     * @param userId
     * @param useState
     * @param lockCouponRecordsIds
     * @return
     */
    int lockUseStateBatch(@Param("userId") long userId, @Param("useState") String useState, @Param("lockCouponRecordsIds") List<Long> lockCouponRecordsIds);

    /**
     * 更新优惠券使用记录
     * @param couponRecordId
     * @param userState
     */
    void updateState(@Param("couponRecordId") Long couponRecordId,@Param("userState") String userState);
}
